//
//  CellForPhotoList.m
//  世界
//
//  Created by admin on 16/2/17.
//  Copyright © 2016年 admin. All rights reserved.
//

#import "CellForPhotoList.h"

@implementation CellForPhotoList

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)dealloc
{
    [_imgView release];
    
    [_lableForTitle release];
    
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self != nil)
    {
        UIColor *bg = [UIColor colorWithPatternImage:[UIImage imageNamed:@"内容背景.jpg"]];
        
        self.contentView.backgroundColor = bg;
        
        self.imgView = [[UIImageView alloc] init];
        
        [self.contentView addSubview:self.imgView];
        
        [_imgView release];
        
        self.lableForTitle = [[UILabel alloc] init];
        
        [self.lableForTitle setFont:[UIFont fontWithName:@"Helvetica-Bold" size:20]];
        
        self.lableForTitle.textAlignment = NSTextAlignmentCenter;
        
        [self.contentView addSubview:self.lableForTitle];
        
        [_lableForTitle release];
    }
    
    return self;
}


- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.imgView.frame = CGRectMake(70, 30, self.contentView.frame.size.width - 140, 220);
    
    self.lableForTitle.frame = CGRectMake(50, 30 + 200 + 30, self.contentView.frame.size.width - 100, 30);
    
    self.imgView.layer.borderWidth = 5;
    
    self.imgView.layer.cornerRadius = 15;
    
    self.imgView.layer.masksToBounds = YES;
    
    self.imgView.layer.borderColor = [[UIColor whiteColor] CGColor];
    
}


@end
